package org.shoukaiseki.supersaiyan.db.inittable.system;

import org.shoukaiseki.inittable.domain.TableColumnInfo;
import org.shoukaiseki.inittable.domain.TableIndexInfo;
import org.shoukaiseki.inittable.service.ITableBuildInfoService;
import org.shoukaiseki.kakaroto.annotation.TableBuild;

import java.util.List;

import static org.shoukaiseki.inittable.utils.SksColumnCamelCaseCommon.uniqueId;
import static org.shoukaiseki.inittable.utils.TableColumnInfoBuilder.column;
import static org.shoukaiseki.inittable.utils.TableIndexInfoBuilder.uniqueIndex;
import static org.shoukaiseki.inittable.utils.TableInfoUtils.tableColumns;
import static org.shoukaiseki.inittable.utils.TableInfoUtils.tableIndexs;

@TableBuild(name = "sys_oper_log", comment = "操作日志",version = 1)
public class SysOperLogInitTableInfo  implements ITableBuildInfoService {


    @Override
    public List<TableColumnInfo> tableColumnInfoList(){
        List<TableColumnInfo> table = tableColumns(

                uniqueId("oper_id","日志主键"),
                column("	title          varchar(50)   default '' null comment '模块标题',"),
                column("	business_type  int           default 0  null comment '业务类型（0其它 1新增 2修改 3删除）',"),
                column("	method         varchar(100)  default '' null comment '方法名称',"),
                column("	request_method varchar(10)   default '' null comment '请求方式',"),
                column("	operator_type  int           default 0  null comment '操作类别（0其它 1后台用户 2手机端用户）',"),
                column("	oper_name      varchar(50)   default '' null comment '操作人员',"),
                column("	dept_name      varchar(50)   default '' null comment '部门名称',"),
                column("	oper_url       varchar(255)  default '' null comment '请求URL',"),
                column("	oper_ip        varchar(128)  default '' null comment '主机地址',"),
                column("	oper_location  varchar(255)  default '' null comment '操作地点',"),
                column("	oper_param     varchar(2000) default '' null comment '请求参数',"),
                column("	json_result    varchar(2000) default '' null comment '返回参数',"),
                column("	status         int           default 0  null comment '操作状态（0正常 1异常）',"),
                column("	error_msg      varchar(2000) default '' null comment '错误消息',"),
                column("	oper_time      datetime                 null comment '操作时间'"),
                null
        );

        return table;
    }

}
